<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>档案销毁页面</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <jsp:include page="/inc/head.jsp" flush="true"/>
    <jsp:include page="/inc/footer.jsp" flush="true"/>
    <!-- picker -->
    <script src="${basePath}/js/devPublic.js"></script>
    <script src="${basePath}/js/My97DatePicker/WdatePicker.js"></script>
    <script src="${basePath }/js/tip.js"></script>
    <style>
     .content  #rowToolBar .box-info {
         border-top:0;
         box-shadow:none;
         margin-bottom:0;
     }
     .content  #rowToolBar .box-info .box-body {
         padding: 0 0 10px 0;
     }
    </style>
</head>
<style media="print">
    body{
        margin:0 auto;
        width: 1010px;
        height: 369px;
    }
    @page {
        size: auto;  /* auto is the initial value */
    margin: 0mm; /* this affects the margin in the printer settings */
    }
</style>
<body class="hold-transition skin-blue sidebar-mini" style="overflow:hidden;">
<input type="hidden" id="flag" name="flag" value="0" >
<input type="hidden" id="sign" name="flag" value="" >
<!-- Main content -->
<section class="content">
    <!-- /rowToolBar -->
    <div id = "rowToolBar" class="row" style="height: 100%;">
        <div class="col-xs-12">
            <div class="box box-info">
                <form class="form-horizontal">
                    <!-- /.box-header -->
                    <div class="box-body btn-group">
                        <button id="btn_history" type="button" class="btn btn-default"  onclick="waitDestroyAction()">
                            <span class="glyphicon glyphicon-paste" aria-hidden="true"></span>待销毁
                        </button>
                        <button id="btn_desarc" type="button" class="btn btn-default"  onclick="checkHistoryDestroyAction()">
                            <span class="glyphicon glyphicon-paste" aria-hidden="true"></span>销毁记录
                        </button>
                        <button id="btn_des" type="button" class="btn btn-default"  onclick="DestroyAction()">
                            <span class="glyphicon glyphicon-paste" aria-hidden="true"></span>销毁
                        </button>
                    </div>
                    <!-- /.box-body -->
                </form>
                <!-- /.form -->
            </div>
            <!-- /.box -->
        </div>
        <!-- /.col-xs-12 -->
    </div>
    <div class="panel panel-default" id="dataMsg">
        <div class="panel-heading">
            <h3 class="panel-title">数据信息</h3>
        </div>
        <div class="table-left">
            <table id="table" >
            </table>
        </div>
    </div>


    <!-- 销毁工作表 -->
    <div id="destroyArchiveModel" class="modal fade addUpdateInfo" tabindex="-1" role="dialog"  aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">

        <div class="modal-dialog" style="width:1200px;">
            <div class="modal-content" style="height: 90%">
                <div id="desTableDiv">



                    <table id="desArchiveTable" class="RollItemTable" width="1000px" align="center">
                        <caption style="text-align:center;font-weight:700;font-size: 20px;margin-bottom: 20px">档案销毁清册</caption>
                            <tr  align="center">
                            <th colspan="4">编号:</th>
                            <th colspan="4">编制单位:</th>
                            <th colspan="3">编制人:</th>
                            <th colspan="3">编制日期:</th>
                            </tr>
                    </table>
                        <table border="1px" width="1000px"  align="center">
                        <tr id="aaa" style="text-align: center">
                            <td colspan="1">序号</td>
                            <td colspan="1">档案分类</td>
                            <td colspan="1">档号</td>
                            <td colspan="1">文号</th>
                            <td colspan="1">题名</th>
                            <td colspan="1">责任者</th>
                            <td colspan="1">件数</th>
                            <td colspan="1">页数</th>
                            <td colspan="1">密级</th>
                            <td colspan="1">归档日期</th>
                            <td colspan="1">应保期限</th>
                            <td colspan="1">已保管时间</th>
                            <td colspan="1">鉴定工作表编号</th>
                            <td colspan="1">备注</th>
                        </tr>
                        <tr>
                            <td colspan="3">档案部门负责人意见</td>
                            <td  colspan="5">
                                <textarea id="desArcview" name="auditDetail"  style="width:100%;border: 0px;resize:none;"></textarea>
                            </td>
                            <td colspan="3">签字:<span><input type="text" id='signatureOne' name='volCatalog'    value='' style="width: 70%;border: 0px"/></span></td>
                            <td colspan="3">日期:<span><input type="text" id='dateOne' name='volCatalog'    value='' style="width: 70%;border: 0px"/></span></td>
                        </tr>
                        <tr>
                            <td colspan="3">归档单位审核意见</td>
                            <td colspan="5">
                                <textarea id="desPersonview" name="auditDetail"  style="width:100%;border: 0px;resize:none;"></textarea>
                            </td>
                            <td colspan="3">签字:<span><input type="text" id='signatureTwo' name='volCatalog'    value='' style="width: 70%;border: 0px"/></span></td>
                            <td colspan="3">日期:<span><input type="text" id='dateTwo' name='volCatalog'    value='' style="width: 70%;border: 0px"/></span></td>
                        </tr>
                        <tr>
                            <td colspan="3">分管领导审批意见</td>
                            <td colspan="5">
                                <textarea id="desLeaderview" name="auditDetail"  style="width:100%;border: 0px;resize:none;"></textarea>
                            </td>
                            <td colspan="3">签字:<span><input type="text" id='signatureThree' name='volCatalog'    value='' style="width: 70%;border: 0px"/></span></td>
                            <td colspan="3">日期:<span><input type="text" id='dateThree' name='volCatalog'     value='' style="width: 70%;border: 0px"/></span></td>
                        </tr>
                        <tr style="height: 45px">
                            <td colspan="3">销毁结果</td>
                            <td colspan="1">
                                <select id="desResult" class="secretLevel" name="volSecret" style="border: 0px;appearance:none;-moz-appearance:none;-webkit-appearance: none;">
                                    <option value=""></option>
                                    <option value="同意">同意</option>
                                    <option value="不同意">不同意</option>
                                </select>
                            </td>
                            <td colspan="10"></td>
                        </tr>
                        </table>
                </div>
                <div class="modal-footer bg-info" style="margin-top: 35px;background-color:#fff;">
                    <button id="closeAppr" type="button" class="btn btn-primary"
                            onclick="closeprint()">取消
                    </button>
                    <button id="printAppr" type="button" class="btn btn-primary"
                            onclick="printSubmitButton()">打印
                    </button>
                    <button id="saveAppr" type="button" class="btn btn-primary"
                            onclick="saveDesSubmitButton()">保存
                    </button>
                    <button id="editAppr" type="button" class="btn btn-primary"
                            onclick="editDesResultSubmitButton()">确认销毁结果
                    </button>
                </div>
            </div>
        </div>
        <input type="hidden" id="desId" name="desId" value="" >
        <input type="hidden" id="volId" name="volId" value="" >
        <input type="hidden" id="itemId" name="itemId" value="" >
        <input type="hidden" id="arcType" name="arcType" value="" >
    </div>
</section>
</body>
<script>
    var $table = $('#table');
    var html = '';
    $(function () {
        var sign="${sign}";
        if(sign != "" || sign != null){
            if (sign == 0) {
                //查询待销毁的档案
                $('#table').bootstrapTable('destroy');
                var url = "${basePath}/pcwindow/searchNeedDestroyVolumeMessage";
                destroyManagerAction(url, judColumn);
            }
            if (sign == 1) {
                $('#table').bootstrapTable('destroy');
                var url = "${basePath}/pcwindow/searchHistoryDesMessage";
                destroyManagerAction(url, apprColumns);
            }
        }else{
            waitDestroyAction();
        }
    })
    /**
     *    解析url,默认查询待销毁的记录
     */
    function waitDestroyAction() {
        $("#sign").val(0);
        $("#flag").val(0);
        //查询待销毁的档案
        $('#table').bootstrapTable('destroy');
        var url = "${basePath}/pcwindow/searchNeedDestroyVolumeMessage";
        destroyManagerAction(url, judColumn);
    }

    /************************************销毁表单（开始）****************************/
    function destroyManagerAction(urla, columns) {
        $table.bootstrapTable({
            url: urla,
            striped: true,
            minimumCountColumns: 2,
            clickToSelect: true,//是否启用点击选中行
            singleSelect: false,
            detailView: false,
            detailFormatter: 'detailFormatter',
            pagination: true,
            pageSize: 50,
            pageList: [50, 100],
            smartDisplay: false,
            paginationLoop: true,
            sidePagination: 'server',
            silentSort: false,
            escape: true,
            searchOnEnterKey: true,
            maintainSelected: true,
            columns: columns,
            onLoadSuccess:function(data){
                //无数据隐藏分页
                if(data && data.total == 0){
                    $('.fixed-table-pagination').hide()
                }
            }
        });
        $table.bootstrapTable('resetView',{height:setHeight()});
    }

    /**
     * 表格高度自适应
     * @return
     * winTop 浏览器视口高度
     * header 顶部通栏
     * breadcrumb 面包屑
     * mainFooter 底部
     */
    function setHeight(){
        var winTop = $(window.top).height(),
            header = window.top.document.querySelector('.main-header').offsetHeight,
            breadcrumb =  window.top.document.querySelector('.breadcrumb').offsetHeight,
            mainFooter = window.top.document.querySelector('.main-footer').offsetHeight;
        return winTop-header-breadcrumb-mainFooter-90;
    }

    var judColumn = [
        {field: 'ck', checkbox: true},
        {field: 'volClass', title: '案卷类型', align: 'center',formatter: 'arcClassSinFormatter'},
        {field: 'volTitle', title: '题名', align: 'center'},
        {field: 'volStorageTime', title: '保管期限', align: 'center',formatter: 'storageTimeSinFormatter'},
        {field: 'volCaseNum', title: '档号', align: 'center'},
        {field: 'volSecret', title: '密级', formatter: 'secretLevelFormatter'},
        {field: 'itemRespons', title: '责任者', align: 'center'},
        {field: 'itemName', title: '文号', align: 'center',},
        {field: 'itemTotalNumber', title: '件数', align: 'center'},
        {field: 'volTotalPage', title: '页数', align: 'center'},
        {field: 'apprCode', title: '鉴定表编号', align: 'center'},
        {field: 'volArchiveDate', title: '归档日期', align: 'center', formatter: 'timeFormatter'},
    ]
    var apprColumns = [
        {field: 'ck', checkbox: true},
        {field: 'desCode', title: '编号', align: 'center'},
        {field: 'desApartment', title: '编制单位', align: 'center'},
        {field: 'desPerson', title: '编制人', align: 'center'},
        {field: 'desDate', title: '编制日期', align: 'center'},
        {field: 'desExtraone', title: '销毁意见', align: 'center'},
        {field: 'desStatus', title: '状态', formatter: 'desStatusFormatter'},
        {
            field: 'action',
            title: '操作',
            align: 'center',
            formatter: 'desActionFormatter',
            events: 'actionEvents',
            clickToSelect: false
        }
    ]
    //格式化文件类型
    function arcClassSinFormatter(value, row, index){
        return archiveType[value];
    }
    //格式化保管期限
    function storageTimeSinFormatter(value, row, index){
        return storageTime[value];
    }
    //格式化密级
    function secretLevelFormatter(value, row, index){
        return secretLevel[value];
    }
    /**
     *    卷状态显示按钮
     */
    function volStatusFormatter(value, row, index) {
        if (row.volStatus == 0) {
            return '<font style="color:dodgerblue;">正常</font>'
        }
        if (row.volStatus == 1) {
            return '<font style="color:grey;">鉴定中</font>'
        }
    }
    /**
     *    销毁状态显示按钮
     */
    function desStatusFormatter(value, row, index) {
        if (row.desStatus == 1 ) {
            return '<font style="color:grey;">销毁中</font>'
        }
        if (row.desStatus == 2) {
            return '<font style="color:grey;">已销毁</font>'
        }
        if (row.desStatus == 3) {
            return '<font style="color:grey;">销毁失败</font>'
        }
    }
    /**
     *    格式化时间(格式YYYY-dd-MM HH:mm:ss)
     */
    function timeFormatter(value, row, index) {
        return formatshortDateTime(value);
    }

    /**
     *    销毁操作按钮
     */
    function desActionFormatter(value, row, index) {
        if (row.desStatus == 1) {
            return '<a style="color:#01579b;" href="javascript:void(0)" onclick="checkDestroyAction(' + row.desId + ')" >确认销毁结果</a>';
        } else{
            return '<a style="color:#01579b;" href="javascript:void(0)" onclick="printDestroyAction(' + row.desId + ')" >打印销毁单</a>';
        }
    }
    /************************************销毁表单（开始）****************************/
    /************************************销毁（开始）****************************/
    /**
     *    销毁操作
     */
    function DestroyAction() {
        $("#sign").val(0);
        $("tr[class='bbb']").empty();
        var flag = $("#flag").val();
        if (flag == 1) {
            //已销毁
            confirmEvent('请选择待销毁文件！');
            return;
        } else {
            var rows = $table.bootstrapTable('getSelections');
            if (rows.length < 1) {
                confirmEvent('请至少选择一条记录！');
            } else {
                html = '';
                for (var i = 0; i < rows.length; i++) {
                    var apprOldDate = "无";
                    var apprRemarks = "无";
                    var apprCode = "无";
                    var volClass = "无";
                    var volCaseNum = "无";
                    var itemName = "无";
                    var volTitle = "无";
                    var itemRespons = "无";
                    var itemTotalNumber = "无";
                    var volTotalPage ="无";
                    var volSecret = "无";
                    var volArchiveDate = "无";
                    var volStorageTime = "无";
                    if (rows[i].apprOldDate != null) {
                        apprOldDate = rows[i].apprOldDate;
                    }
                    if (rows[i].apprRemarks != null) {
                        apprRemarks = rows[i].apprRemarks;
                    }
                    if (rows[i].apprCode != null) {
                        apprCode = rows[i].apprCode;
                    }
                    if (rows[i].volClass != null) {
                        volClass= archiveType[rows[i].volClass];
                        if(volClass == undefined){
                            volClass='';
                        }
                    }
                    if (rows[i].volCaseNum != null) {
                        volCaseNum = rows[i].volCaseNum;
                    }
                    if (rows[i].itemName != null) {
                        itemName = rows[i].itemName;
                    }
                    if (rows[i].volTitle != null) {
                        volTitle = rows[i].volTitle;
                    }
                    if (rows[i].itemRespons != null) {
                        itemRespons = rows[i].itemRespons;
                    }
                    if (rows[i].itemTotalNumber != null) {
                        itemTotalNumber = rows[i].itemTotalNumber;
                    }
                    if (rows[i].volTotalPage != null) {
                        volTotalPage = rows[i].volTotalPage;
                    }
                    if (rows[i].volSecret != null) {
                        volSecret= secretLevel[rows[i].volSecret];
                        if(volSecret == undefined){
                            volSecret='';
                        }
                    }
                    if (rows[i].volArchiveDate != null) {
                        volArchiveDate = formatshortDateTime(rows[i].volArchiveDate);
                    }
                    if (rows[i].volStorageTime != null) {
                        volStorageTime= storageTime[rows[i].volStorageTime];
                        if(volStorageTime == undefined){
                            volStorageTime='';
                        }
                    }
                    var num = i + 1;
                    html += '<tr class="bbb" style="text-align: center">' +
                        '<td colspan="1">' + num + '</td>' +
                        '<td colspan="1">' + volClass + '</td>' +
                        '<td colspan="1">' + volCaseNum + '</td>' +
                        '<td colspan="1">' + itemName + '</td>' +
                        '<td colspan="1">' + volTitle + '</td>' +
                        '<td colspan="1">' + itemRespons + '</td>' +
                        '<td colspan="1">' + itemTotalNumber + '</td>' +
                        '<td colspan="1">' + volTotalPage + '</td>' +
                        '<td colspan="1">' + volSecret + '</td>' +
                        '<td colspan="1">' + volArchiveDate + '</td>' +
                        '<td colspan="1">' + volStorageTime + '</td>' +
                        '<td colspan="1">' + apprOldDate + '</td>' +
                        '<td colspan="1">' + apprCode + '</td>' +
                        '<td colspan="1">' + apprRemarks + '</td>' +
                        '</tr>'
                }
                $("#aaa").after('');
                $("#aaa").after(html);
                $("#editAppr").hide();
                $("#saveAppr").show();
                $('#destroyArchiveModel').modal({
                    keyboard: true
                });
            }
        }

    }
    /**
     *    保存销毁信息
     */
    function saveDesSubmitButton() {
        var rows = $table.bootstrapTable('getSelections');
        var desId = $("#desId").val();
        var desCode = $("#desCode").val();//销毁表编号
        var desApartment = $("#desApartment").val();//编制单位
        var desPerson = $("#desPerson").val();//编制人
        var desDate = $("#desDate").val();//编制日期
        var desArcview = $("#desArcview").val();//档案部门负责人意见
        var desPersonview = $("#desPersonview").val();//归档单位审核意见
        var desLeaderview = $("#desLeaderview").val();//分管领导审批意见
        var desResult = $("#desResult").find(":selected").val();//销毁结果
        var signatureOne = $("#signatureOne").val();//签字
        var dateOne = $("#dateOne").val();//日期
        var signatureTwo = $("#signatureTwo").val();//签字
        var dateTwo = $("#dateTwo").val();//日期
        var signatureThree = $("#signatureThree").val();//签字
        var dateThree = $("#dateThree").val();//日期
        var data = {
            rows: JSON.stringify(rows),
            desId: desId,
            desCode: desCode,
            desApartment: desApartment,
            desPerson: desPerson,
            desDate: desDate,
            desArcview: desArcview,
            desPersonview: desPersonview,
            desLeaderview: desLeaderview,
            dateTwo: dateTwo,
            signatureTwo: signatureTwo,
            signatureThree: signatureThree,
            dateThree: dateThree,
            signatureOne: signatureOne,
            dateOne: dateOne,
            desResult:desResult,
        };
        $.ajax({
            url: '${basePath}/pcwindow/insertDesMessage',
            data: data,
            type: "post",
            dataType: "json",
            success: function (result) {
                confirmEvent('保存成功!');
                $("#desId").val(result.msg);
                var url = "${basePath}/pcwindow/searchNeedDestroyVolumeMessage";
                destroyManagerAction(url, judColumn);
            },
            error: function () {
                confirmEvent('系统开小差了，请稍后再试!');
            }
        })
    }
    /**
     *    验证销毁表编号
     */
    function chooseCode() {
        var desCode = $("#desCode").val();//编号
        $.ajax({
            url: '${basePath}/pcwindow/chooseCodeRepeat',
            data: {desCode: desCode},
            type: "post",
            dataType: "json",
            success: function (result) {
                if (result.status != 200) {
                    confirmEvent('该编号已经存在!');
                }
            },
            error: function () {
                confirmEvent('系统开小差了，请稍后再试!');
            }
        })
    }
    /**
     *    确认销毁结果按钮
     */
    function editDesResultSubmitButton() {
        var rows = $table.bootstrapTable('getSelections');
        var desId = rows[0].desId;
        var desMnaview = $("#desArcview").val();//档案部门负责人意见
        var desOrgview = $("#desPersonview").val();//归档单位审核意见
        var desLeaderview = $("#desLeaderview").val();//分管领导审批意见
        var desResult = $("#desResult").find(":selected").val();//销毁结果
        if(desResult == ""){
            confirmEvent('请选择销毁结果!');
        }else{
            var signatureTwo = $("#signatureTwo").val();
            var dateTwo = $("#dateTwo").val();
            var signatureThree = $("#signatureThree").val();
            var dateThree = $("#dateThree").val();
            var signatureOne = $("#signatureOne").val();
            var dateOne = $("#dateOne").val();
            var data = {
                desId: desId,
                desMnaview: desMnaview,
                desOrgview: desOrgview,
                desLeaderview: desLeaderview,
                desResult: desResult,
                dateTwo: dateTwo,
                signatureTwo: signatureTwo,
                signatureThree: signatureThree,
                dateThree: dateThree,
                signatureOne: signatureOne,
                dateOne: dateOne,
            };
            $.ajax({
                url: '${basePath}/pcwindow/updateResultDesMessage',
                data: data,
                type: "post",
                dataType: "json",
                success: function (result) {
                    if (result.status == 200) {
                        confirmEvent('保存销毁结果信息成功!');
                    }
                },
                error: function () {
                    confirmEvent('系统开小差了，请稍后再试!');
                }
            })
        }
    }
    /**
     *    填写销毁结果按钮，回显销毁信息，打印
     */
    function checkDestroyAction(desId) {
        loaddesMessage(desId);
        $("#saveAppr").hide();
        $("#editAppr").show();
    }
    /**
     *    查看销毁结果按钮，回显销毁信息，打印
     */
    function printDestroyAction(desId) {
        loaddesMessage(desId);
        $("#saveAppr").hide();
        $("#editAppr").hide();
        $('#destroyArchiveModel').modal({
            keyboard: true
        });
    }

    /**
     *    加载回显销毁表信息
     */
    function loaddesMessage(desId) {
        var rows = $table.bootstrapTable('getSelections');
        if (rows.length != 1) {
            confirmEvent('请选择一条记录！');
        } else {
            loadDesJudVolumeMessage(desId);
            //显示销毁信息
            $("#desResult").val(rows[0].desExtraone);//销毁结果
            $("#desId").val(rows[0].desId);
            $("#desCode").val(rows[0].desCode);//编号
            $("#desApartment").val(rows[0].desApartment);//编制单位
            $("#desPerson").val(rows[0].desPerson);//编制人
            $("#desDate").val(rows[0].desDate);//编制日期
            $("#desArcview").val(rows[0].desMnaview);//档案部门负责人意见
            $("#desPersonview").val(rows[0].desOrgview);//鉴定人意见
            $("#desLeaderview").val(rows[0].desLeaderview);//分管领导审批意见
            $('#destroyArchiveModel').modal({
                keyboard: true
            });
        }
    }
    /**
     *    加载回显销毁——用户表信息
     */
    function loadDesJudVolumeMessage(desId) {
        $("tr[class='bbb']").empty();
        //根据销毁表id查询销毁记录
        $.ajax({
            type: 'POST',
            url: '${basePath}/pcwindow/checkDestroyArcByDesId',
            dataType: "json",
            data: {
                desId: desId,
            },
            async: false,
            success: function (data) {
                if (data.length != 0) {
                    html = '';
                    for (var i = 0; i < data.length; i++) {
                        var apprOldDate = "无";
                        var apprRemarks = "无";
                        var apprCode = "无";
                        var volClass = "无";
                        var volCaseNum = "无";
                        var itemName = "无";
                        var volTitle = "无";
                        var itemRespons = "无";
                        var itemTotalNumber = "无";
                        var volTotalPage ="无";
                        var volSecret = "无";
                        var volArchiveDate = "无";
                        var volStorageTime = "无";
                        if (data[i].apprOldDate != null) {
                            apprOldDate = data[i].apprOldDate;
                        }
                        if (data[i].apprRemarks != null) {
                            apprRemarks = data[i].apprRemarks;
                        }
                        if (data[i].apprCode != null) {
                            apprCode = data[i].apprCode;
                        }
                        if (data[i].volClass != null) {
                            volClass= archiveType[data[i].volClass];
                            if(volClass == undefined){
                                volClass='';
                            }
                        }
                        if (data[i].volCaseNum != null) {
                            volCaseNum = data[i].volCaseNum;
                        }
                        if (data[i].itemName != null) {
                            itemName = data[i].itemName;
                        }
                        if (data[i].volTitle != null) {
                            volTitle = data[i].volTitle;
                        }
                        if (data[i].itemRespons != null) {
                            itemRespons = data[i].itemRespons;
                        }
                        if (data[i].itemTotalNumber != null) {
                            itemTotalNumber = data[i].itemTotalNumber;
                        }
                        if (data[i].volTotalPage != null) {
                            volTotalPage = data[i].volTotalPage;
                        }
                        if (data[i].volSecret != null) {
                            volSecret= secretLevel[data[i].volSecret];
                            if(volSecret == undefined){
                                volSecret='';
                            }
                        }
                        if (data[i].volArchiveDate != null) {
                            volArchiveDate = formatshortDateTime(data[i].volArchiveDate);
                        }
                        if (data[i].volStorageTime != null) {
                            volStorageTime= storageTime[data[i].volStorageTime];
                            if(volStorageTime == undefined){
                                volStorageTime='';
                            }
                        }
                        var num = i + 1;
                    html += '<tr class="bbb" style="text-align: center">' +
                        '<td colspan="1">' + num + '</td>' +
                        '<td colspan="1">' + volClass + '</td>' +
                        '<td colspan="1">' + volCaseNum + '</td>' +
                        '<td colspan="1">' + itemName + '</td>' +
                        '<td colspan="1">' + volTitle + '</td>' +
                        '<td colspan="1">' + itemRespons + '</td>' +
                        '<td colspan="1">' + itemTotalNumber + '</td>' +
                        '<td colspan="1">' + volTotalPage + '</td>' +
                        '<td colspan="1">' + volSecret + '</td>' +
                        '<td colspan="1">' + volArchiveDate + '</td>' +
                        '<td colspan="1">' + volStorageTime + '</td>' +
                        '<td colspan="1">' + apprOldDate + '</td>' +
                        '<td colspan="1">' + apprCode + '</td>' +
                        '<td colspan="1">' + apprRemarks + '</td>' +
                        '</tr>'
                }
                $("#aaa").after('');
                $("#aaa").after(html);
                }
            }
        });
    }
    /**
     *    查看历史销毁记录
     */
    function checkHistoryDestroyAction() {
        $("#sign").val(1);
        $("#flag").val(1);
        $('#table').bootstrapTable('destroy');
        var url = "${basePath}/pcwindow/searchHistoryDesMessage";
        destroyManagerAction(url, apprColumns);
    }
    /************************************销毁（结束）****************************/

    /************************************打印销毁Table（开始）****************************/
    function printSubmitButton() {
                print.portrait = false ;
                bindData();
                var headstr = "<html><head><title></title></head><body>";
                var footstr = "</body>";
                var newstr = document.getElementById("desTableDiv").innerHTML;
                //获得 div 里的所有 html 数据
                var oldstr = document.body.innerHTML;
                document.body.innerHTML = headstr + newstr + footstr;
                window.print();
                document.body.innerHTML = oldstr;
                return false;
        }

    //将表单中手动填写的数据进行绑定，便于html()的时候获取到
    function bindData() {
        //搞定 type=text, 同时如果checkbox,radio,select>option的值有变化, 也绑定一下, 这里忽略button
        $("input,select option").each(function () {
            $(this).attr('value', $(this).val());
        });

        //搞定 type=checkbox,type=radio 选中状态
        $("input[type='checkbox'],input[type='radio']").each(function () {
            if ($(this).attr('checked'))
                $(this).attr('checked', true);
            else
                $(this).removeAttr('checked');
        });

        //搞定select选中状态
        $("select option").each(function () {
            if ($(this).attr('selected'))
                $(this).attr('selected', true);
            else
                $(this).removeAttr('selected');
        });

        //搞定 textarea
        $("textarea").each(function () {
            $(this).html($(this).val());
        });
    }
    /************************************打印销毁Table（结束）****************************/
    function closeprint() {
        html = '';
        var sign = $("#sign").val();
        window.location.href = '${basePath}/pcwindow/arcDestroy?sign=' + sign;
    }
</script>
</html>